<h2><?php echo $this->translate('Listing contacts'); ?></h2>
<div class="grid_12 alpha omega"><?= $this->flashMessenger(); ?></div>
<div class="clearfix"></div>
<p><a href="<?php echo $this->url(array(), 'pages_contacts_create'); ?>"><?php echo $this->translate('Create a new contact'); ?></a></p>

<div class="grid_12 alpha omega">
	<table width="100%">
		<thead>
			<tr>
				<th><?php echo $this->translate('ID'); ?></th>
				<th><?php echo $this->translate('Title'); ?></th>
				<th><?php echo $this->translate('Name of position'); ?></th>
				<th><?php echo $this->translate('Position'); ?></th>
				<th><?php echo $this->translate('Published'); ?></th>
				<th><?php echo $this->translate('Is main contact'); ?></th>
				<th><?php echo $this->translate('Actions'); ?></th>
			</tr>
		</thead>
		<tbody>
			<?php if($this->contacts->count() > 0): ?>
				<?php foreach ($this->contacts as $contact):?>
					<tr>
						<td><?= $contact->id;?></td>
						<td><?= $contact->Translation[$this->LANG]->title;?></td>
						<td><?= $contact->Pages_Model_Geocoord->Translation[$this->LANG]->name;?></td>
						<td><?= $contact->Pages_Model_Geocoord->coord;?></td>
						<td style="text-align:center;"><?= $this->IconPublished($contact->published);?></td>
						<td style="text-align:center;"><?= $this->IconPublished($contact->is_main);?></td>
						<td style="text-align:center;">
							<a href="<?php echo $this->url(array('id' => $contact->id), 'pages_contacts_update'); ?>">
								<?php echo $this->translate('Edit');?>
							</a> &nbsp;|&nbsp;
							<a href="<?php echo $this->url(array('id' => $contact->id), 'pages_contacts_delete'); ?>" onclick="return confirm('<?= $this->translate('Are you sure');?>');">
								<?php echo $this->translate('Delete');?>
							</a>
						</td>
					</tr>
				<?php endforeach;?>
			<?php else: ?>
				<tr>
					<td colspan="8">
						<?= $this->translate('No data to display'); ?>
					</td>
				</tr>
			<?php endif; ?>
		</tbody>
	</table>
</div>